package com.amigo.online.provider.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.amigo.online.common.base.controller.BaseController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.provider.manager.util.param.dto.PageDto;
import com.amigo.online.provider.manager.util.video.uploading.QiniuUtil;

@RestController
@RequestMapping(value = "/util", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UtilController extends BaseController {

    @Autowired
    private QiniuUtil qiniuUtil;

    @PostMapping(value = "/get_UpToken")
    public ResponseEntity<Response> get_UpToken(@RequestBody PageDto pageDto) {

        JSONObject result = new JSONObject();

        result.put("token", qiniuUtil.queryUpToken(pageDto));

        return success(result);
    }

}
